package com.tvunetworks.center.user.mapper;

import com.tvunetworks.center.user.model.UserInstance;
import com.tvunetworks.center.user.model.param.PageUserInstanceParam;
import com.tvunetworks.center.user.model.vo.InstanceMessageVo;
import com.tvunetworks.center.user.model.vo.UserInstanceVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
/**
 * @program:
 * @description:
 * @author HenryChen
 * @create: 5/29/2019 12:17 PM
 **/
public interface UserInstanceMapper extends Mapper<UserInstance> {
    /**
     *
     * @param param param
     * @return List
     */
    List<UserInstanceVo> listUserInstance(PageUserInstanceParam param);

    /**
     *
     * @return List
     */
    List<UserInstance> listNeedBindRecord();

    /**
     *
     * @return List
     */
    List<UserInstance> listNeedReleaseRecord();

    /**
     *
     * @return List
     */
    List<String> listRunningInstanceId();

    /**
     *
     * @param instanceIds instanceIds
     * @return List
     */
    List<UserInstance> listByInstanceIds(@Param("instanceIds") List<String> instanceIds);

    /**
     *
     * @param now now
     * @return List
     */
    List<String> listNeedShutdownInstancePrimaryKey(@Param("now") Long now);

    /**
     * 根据imageType分页获取正在执行的instanceId
     * @param imageType imageType
     * @return List
     */
    List<String> pageRunningInstance(@Param("imageType") List<String> imageType);

    /**
     * 获取查询instanceId对应的信息
     * @param instanceIds instanceIds
     * @return 返回查询instanceId对应的信息
     */
    List<InstanceMessageVo> getInstanceMessage(@Param("instanceIds") List<String> instanceIds);

}
